package icu.liuwisdom.util;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * http跑龙套
 *
 * @author 郑涵文
 * @date 2023/02/08
 */
@Component
public class HttpUtil {

    OkHttpClient client = new OkHttpClient();

   public String run(String url) throws IOException {
        Request request = new Request.Builder()
                .url(url)
                .build();

        try (Response response = client.newCall(request).execute()) {
            return response.body().string();
        }
    }

}
